﻿//操作会员离开
function Leave(gid,j)
{
    if(__P_M=="")
    {
        top.location = "/user/login.htm?IsShow=1&ReturnUrl="+top.location.href;return;
    }
         showProgressBar(false,true);
          $("$divIput$").style.display = "none";
          var gt1=j.replace(/\$d\$/gi,"\'").replace(/\$s\$/gi,"\"");
    var leaveDesc="<div style='width:370px; overflow:hidden'>"+GP115.replace(/\{0\}/gi,gt1)+"</div><br/><div class='Popup_button'><input value='"+GP230+"' class='button' onclick='opWebSerLeave("+gid+")' type='button'/>&nbsp;&nbsp;<input type='button' value='"+C0056+"' class='buttong' onclick='webFailure()' /></div>";     
        var obj = {}
        $ShowMessageBox$(leaveTitle,leaveDesc,obj,webFailure,400);
}
//执行离开
function opWebSerLeave(f)
{
    $EndMessageBox$();
    $("LeaveGID").value=f;
    $("Form1").action = lhost+"/groups/my-groups.htm";
    $("Form1").submit();
}
//加入组
function Join(gid,jo,ti)
{
    if(__P_M=="")
    {
        top.location = "/user/login.htm?IsShow=1&ReturnUrl="+top.location.href;return;
    }
   if(jo=="2")
   {
    showProgressBar(false,true);  
    $("$divIput$").style.display = "none";
        var _joinDesc="<div style='width:370px; overflow:hidden'>"+joinDesc+"</div><br/><div class='Popup_button'><input value='"+GP232+"' class='button' onclick='opWebSerJoin("+gid+",\""+ti+"\")' type='button'/>&nbsp;&nbsp;<input type='button' value='"+C0056+"' class='buttong' onclick='webFailure()' /></div>";         
        var obj = {}
        $ShowMessageBox$(joinTitle,_joinDesc,obj,webFailure,400);
    }
    else
    {
     showProgressBar(false,true);   
     $("$divIput$").style.display = "none";
        var _joinDesc1="<div style='width:370px; overflow:hidden'>"+joinDesc1+"</div><br/><div class='Popup_button'><input value='"+GP231+"' class='button' onclick='opWebSerJoin1("+gid+")' type='button'/>&nbsp;&nbsp;<input type='button' value='"+C0056+"' class='buttong' onclick='webFailure()' /></div>";     
        var obj = {f: gid}
        $ShowMessageBox$(joinTitle,_joinDesc1,obj,webFailure,400);
       
    }
}
//加入组需要验证的掉用WebServices方法操作
function opWebSerJoin(f,t)
{
var t1=t.replace(/\$d\$/gi,"\'").replace(/\$s\$/gi,"\"");
    WebServices.WWW.Groups.JoinGroup(f,NickName,t1,onsuccGroup,webFailure,"0");
}
//加入组不要验证的表单提交刷新操作
function opWebSerJoin1(f)
{
   $EndMessageBox$();
    $("Rety").value="join";
    $("Form1").action = lhost+"/groups/"+f;
    $("Form1").submit();
}
//加入组需要验证的掉用WebServices方法操作成功时候
function onsuccGroup(result,j)
{
    if(result.State)
    {  
    
    if(j=="0"){
            $EndMessageBox$();
            window.location.reload();
            }
    }
    else
    {
        $EndMessageBox$();
    }
}
//调用webService方法失败
function webFailure()
{
    $EndMessageBox$();
}